import { createStore } from "redux";

const defaultState={
  isOpenLoginCard:true
}

function reducer(state=defaultState, action ) {
  const newState = JSON.parse(JSON.stringify(state))
  switch (action.type) {
    case 'OPENLOGINCARD':
      newState.isOpenLoginCard = true
      return newState
    case 'CLOSELOGINCARD':
      newState.isOpenLoginCard = false
      return newState
    default: return state
  }
}

const store = createStore(reducer)
export default store